package zust.se.delicious.action;

import zust.se.delicious.service.UserService;
import zust.se.delicious.vo.RegisterUserBean;

import com.opensymphony.xwork2.ActionSupport;

public class RegisterAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private RegisterUserBean registerUser;
	private UserService userService;

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	public RegisterUserBean getRegisterUser() {
		return registerUser;
	}

	public void setRegisterUser(RegisterUserBean registerUser) {
		this.registerUser = registerUser;
	}

	public String execute() {
		
		if (userService.register(registerUser)) {
			return SUCCESS;
		}
		return ERROR;
	}
}
